package com.hq.fxh.HttpApi;

import android.content.Context;

import com.hq.fxh.Modle.AutoNewsListModle;
import com.hq.fxh.Modle.AutoNewsModle;
import com.hq.fxh.Modle.CityModle;
import com.hq.fxh.Modle.CityUrlModle;
import com.hq.fxh.Modle.CreateMemberRes;
import com.hq.fxh.Modle.FavotityListGetModle;
import com.hq.fxh.Modle.FollowUserModle;
import com.hq.fxh.Modle.ForgetPwdRes;
import com.hq.fxh.Modle.GetAllRankRes;
import com.hq.fxh.Modle.GetAutoNewsHomeModle;
import com.hq.fxh.Modle.GetDayStatisticalResultRes;
import com.hq.fxh.Modle.GetEnterpriseMaterialRes;
import com.hq.fxh.Modle.GetEnterpriseRankRes;
import com.hq.fxh.Modle.GetEnterpriseReportRes;
import com.hq.fxh.Modle.GetEntertainmentListRes;
import com.hq.fxh.Modle.GetMaterialByCategoryIdRes;
import com.hq.fxh.Modle.GetMaterialCategoryRes;
import com.hq.fxh.Modle.GetMyPostModle;
import com.hq.fxh.Modle.GetPushBaseInfoRes;
import com.hq.fxh.Modle.GetPushDataRes;
import com.hq.fxh.Modle.GetPushDetailInfoRes;
import com.hq.fxh.Modle.GetPushStatisticListRes;
import com.hq.fxh.Modle.GetUserNumData;
import com.hq.fxh.Modle.GetVideoListModle;
import com.hq.fxh.Modle.GetWeekStatisticalResultRes;
import com.hq.fxh.Modle.JianLiModle;
import com.hq.fxh.Modle.JianLiUpModle;
import com.hq.fxh.Modle.KanTieListModle;
import com.hq.fxh.Modle.MyResponseBody;
import com.hq.fxh.Modle.PlateListModle;
import com.hq.fxh.Modle.PlateSoreModle;
import com.hq.fxh.Modle.RequstReq;
import com.hq.fxh.Modle.SelectByCategoryIdRes;
import com.hq.fxh.Modle.SelectByMemberIdRes;
import com.hq.fxh.Modle.SelectByMobileAndPwdRes;
import com.hq.fxh.Modle.SelectByMobileRes;
import com.hq.fxh.Modle.SpaceUserPostModle;
import com.hq.fxh.Modle.Space_UserVideo_Modle;
import com.hq.fxh.Modle.UploadImgRes;
import com.hq.fxh.Modle.UserGetModle;
import com.hq.fxh.No3_TuiGuang.MyMoBan.Model.CommonRes;
import com.hq.fxh.No3_TuiGuang.MyMoBan.Model.GetAdvertByUidRes;
import com.hq.fxh.No3_TuiGuang.MyMoBan.Model.GetHomePageByUidRes;
import com.hq.fxh.No3_TuiGuang.MyMoBan.Model.GetWebUrlRes;
import com.hq.fxh.Utils.AppConstant;
import com.hq.fxh.Utils.LogUtils;
import com.hq.fxh.Utils.SharedPreferenceUtils;

import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.http.Body;
import retrofit2.http.Url;
import rx.Observable;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

import static android.R.attr.id;
import static com.baidu.location.h.j.C;
import static com.baidu.location.h.j.c;
import static com.baidu.location.h.j.t;
import static com.tencent.upload.common.Global.context;

/**
 * /**
 *
 * @author 薛
 * @ClassName
 * @Description :
 * @Created 2017/8/15
 * @Email xlwenhao1858@sina.com
 */


public class UserServiceImpl {
    public static UserService userService;
    static String baseV5Url = "http://ledianduo.com:8088/v5/api.asmx/";
    static String GetPostCagetoryUrl = baseV5Url + "GetPostCagetory";
    static String insertPlateUrl = baseV5Url + "InsertPost";
    static String getPlateListUrl = baseV5Url + "GetPostByCategory";
    static String getKanTieListUrl = baseV5Url + "GetPostList";
    static String FollowerCategoryUrl = baseV5Url + "FollowerCategory";
    static String getCityUrl = "https://mobileapi.ledianduo.com/demoapi.asmx/GetProvinceAndCitys";

    static String FollowerUserUrl = baseV5Url + "FollowerUser";
    static String GetFollowerListUrl = baseV5Url + "GetFollowerList";
    static String BlackUserUrl = baseV5Url + "BlackUser";
    static String GetBlackListUrl = baseV5Url + "GetBlackList";
    static String UpdateResumeUrl = baseV5Url + "UpdateResume";
    static String GetResumeUrl = baseV5Url + "GetResume";
    static String AddResumeWorkUrl = baseV5Url + "AddResumeWork";
    static String DelResumeWorkUrl = baseV5Url + "DelResumeWork";
    static String GetResumeWorkUrl = baseV5Url + "GetResumeWork";
    static String GetResumeEduUrl = baseV5Url + "GetResumeEdu";
    static String DelResumeEduUrl = baseV5Url + "DelResumeEdu";
    static String AddResumeEduUrl = baseV5Url + "AddResumeEdu";
    static String UpdateResumeWishUrl = baseV5Url + "UpdateResumeWish";
    static String GetResumeWishUrl = baseV5Url + "GetResumeWish";

    static String SetResumePublicUrl = baseV5Url + "SetResumePublic";
    static String GetMyPostUrl = baseV5Url + "GetMyPost";
    static String delMyPostUrl = baseV5Url + "DelPost";
    static String AddFavoritesUrl = baseV5Url + "AddFavorites";
    static String DelFavoritesUrl = baseV5Url + "DelFavorites";
    static String GetFavoritesUrl = baseV5Url + "GetFavorites";
    static String ClearNewFansNotifyUrl = baseV5Url + "ClearNewFansNotify";
    static String AutoRefreshHomeUrl = baseV5Url + "AutoRefreshHome";
    static String sentCommment = "http://ledianduo.com:8088/v5/api.asmx/Comment";
    static String GetNewsListUrl = baseV5Url + "GetNewsList";
    static String UpdateMemberInfoUrl = baseV5Url + "UpdateMemberInfo";
    static String GetMemberInfoUrl = baseV5Url + "GetMemberInfo";
    static String GetUserPostListUrl = baseV5Url + "GetUserPostList";
    static String GetUserVideoListUrl = baseV5Url + "GetVideoList";


    public static void GetUSerVideoList(int page, int pageSize, int member_id, Callback<Space_UserVideo_Modle> callback) {
        Call<Space_UserVideo_Modle> responseBodyCall = userService.GetUserVideoList(GetUserVideoListUrl, member_id, page, pageSize);
        responseBodyCall.enqueue(callback);

    }

    public static void GetUserPostList(int to_uid, int page, int page_size, Callback<SpaceUserPostModle> callback) {
        Call<SpaceUserPostModle> responseBodyCall = userService.GetUserPlateList(GetUserPostListUrl, to_uid, page, page_size);
        responseBodyCall.enqueue(callback);
    }

    /* 热文榜   type  1 3日  2  一周  3 月*/
    public static void getHotArticle(int type, Subscriber<GetAllRankRes> subscriber) {
        userService.getHotArticle(type)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    public static void GetNewsList(int type, String cityCode, int last_index, Callback<AutoNewsListModle> callback) {
        Call<AutoNewsListModle> getAutoNewsHomeModleCall = userService.GetNewsList(GetNewsListUrl, type, cityCode, last_index);
        getAutoNewsHomeModleCall.enqueue(callback);
    }

    public static void UpdateMemberInfoUrl(String uid, String sex, String nickName, String face, String province, String city, String address, String province_id, String city_id, String tag, String birth, Callback<MyResponseBody> callback) {
        Call<MyResponseBody> myResponseBodyCall = userService.UpdateMemberInfo(UpdateMemberInfoUrl, uid, sex, nickName, face, province, city, address, province_id, city_id, tag, birth);
        myResponseBodyCall.enqueue(callback);
    }

    public static void GetMemberInfoUrl(int uid, Callback<UserGetModle> callback) {
        Call<UserGetModle> myResponseBodyCall = userService.GetMemberInfo(GetMemberInfoUrl, uid);
        myResponseBodyCall.enqueue(callback);
    }

    public static void getPushStatisticList(Subscriber<GetPushStatisticListRes> subscriber) {
        userService.getPushStatisticList()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    public static void getPushDetailInfo(Subscriber<GetPushDetailInfoRes> subscriber) {
        userService.getPushDetailInfo()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    public static void getPushBaseInfo(Subscriber<GetPushBaseInfoRes> subscriber) {
        userService.getPushBaseInfo()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    public static void getPushData(int type, Subscriber<GetPushDataRes> subscriber) {
        userService.getPushData(type)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }


    public static void getUserData(int memberID, Subscriber<GetUserNumData> subscriber) {
        userService.GetUserData(memberID)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    public static void GetAutoRefreshHome(int id, Callback<GetAutoNewsHomeModle> callback) {
        Call<GetAutoNewsHomeModle> myResponseBodyCall = userService.AutoRefreshHome(AutoRefreshHomeUrl, id);
        myResponseBodyCall.enqueue(callback);
    }

    public static void clearUserData(Callback<MyResponseBody> callback) {
        Call<MyResponseBody> myResponseBodyCall = userService.ClearUserData(ClearNewFansNotifyUrl);
        myResponseBodyCall.enqueue(callback);
    }

    public static void getGpsCity(String url, Callback<CityUrlModle> callback) {
        Call<CityUrlModle> myResponseBodyCall = userService.getGpsCity(url);
        myResponseBodyCall.enqueue(callback);
    }

    /*获取评论列表*/

    public static void GetComment(int type, int target_id, int page, int page_size, Subscriber<ResponseBody> subscriber) {
        userService.GetComment(type, target_id, page, page_size)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    //  点赞
    public static void setGood(int type, int target_id, Subscriber<MyResponseBody> subscriber) {
        userService.SetGood(type, target_id)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    // 评论
    public static void Comment(int type, int target_id, int comment_id, String content, Subscriber<ResponseBody> subscriber) {
        userService.Comment(type, target_id, comment_id, content)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    public static void Comment2(int type, int target_id, int comment_id, String content, Callback<ResponseBody> callback) {
        Call<ResponseBody> comment = userService.Comment2(sentCommment, type, target_id, comment_id, content);
        comment.enqueue(callback);


    }

    public static void getVideoUploadSign(Subscriber<CommonRes> subscriber) {
        userService.getVideoUploadSign()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    public static void AddFavorites(int type, String newID, Callback<ResponseBody> callback) {
        /// <param name="type">类型 1新闻 2论坛帖子 3视频</param>  int type, int target_id

        Call<ResponseBody> responseBodyCall = userService.AddFavorites(AddFavoritesUrl, type, newID);
        responseBodyCall.enqueue(callback);

    }

    public static void DelFavorites(int type, String memberId, Callback<ResponseBody> callback) {
        Call<ResponseBody> responseBodyCall = userService.DelFavorites(DelFavoritesUrl, type, memberId);
        responseBodyCall.enqueue(callback);
    }

    public static void GetFavorites(int page, int pagesize, Callback<FavotityListGetModle> callback) {
        Call<FavotityListGetModle> responseBodyCall = userService.GetFavorites(GetFavoritesUrl, page, pagesize);
        responseBodyCall.enqueue(callback);

    }


    public static void getMySelfEntertainmentList(int page, int pageSize, int type, Subscriber<GetEntertainmentListRes> subscriber) {
        userService.getMySelfEntertainmentList(page, pageSize, type)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    public static void getVideo(int Uid, int page, int pageSize, Subscriber<GetVideoListModle> subscriber) {
        userService.getVideo(Uid, page, pageSize)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }


    public static void delMyVideo(String subjectId, int type, Subscriber<CommonRes> subscriber) {
        userService.delSubject(subjectId, type)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    public static void delMyPlate(int memberId, Callback<ResponseBody> callback) {
        Call<ResponseBody> responseBodyCall = userService.DelMyPlate(delMyPostUrl, memberId);
        responseBodyCall.enqueue(callback);

    }

    public static void GetMyPost(int page, int pagesize, Callback<GetMyPostModle> callback) {
        Call<GetMyPostModle> myPost = userService.getMyPost(GetMyPostUrl, page, pagesize);
        myPost.enqueue(callback);

    }

    public static void getResumeWish(String User_id, Callback<ResponseBody> callback) {
        Call<ResponseBody> jianLiUpModleCall = userService.GetResumeWish(GetResumeWishUrl, User_id);
        jianLiUpModleCall.enqueue(callback);

    }

    public static void updateResumeWish(String json, String id, Callback<ResponseBody> callback) {
        Call<ResponseBody> jianLiUpModleCall = userService.UpdateResumeWish(UpdateResumeWishUrl, json, id);
        jianLiUpModleCall.enqueue(callback);

    }

    public static void getJianLiEdu(String user_id, Callback<ResponseBody> callback) {
        Call<ResponseBody> jianLiUpModleCall = userService.getJianLiEdu(GetResumeEduUrl, user_id);
        jianLiUpModleCall.enqueue(callback);

    }

    public static void SetResumePublic(int uid, int is_publish, Callback<ResponseBody> callback) {
        Call<ResponseBody> jianLiUpModleCall = userService.SetResumePublic(SetResumePublicUrl, uid + "", is_publish);
        jianLiUpModleCall.enqueue(callback);

    }


    public static void getJianLiWork(String user_id, Callback<ResponseBody> callback) {
        Call<ResponseBody> jianLiUpModleCall = userService.getJianLiWork(GetResumeWorkUrl, user_id);
        jianLiUpModleCall.enqueue(callback);

    }

    public static void deleteJianLiWork(String Woke_id, Callback<ResponseBody> callback) {
        Call<ResponseBody> jianLiUpModleCall = userService.deleteJianLiWork(DelResumeWorkUrl, Woke_id);
        jianLiUpModleCall.enqueue(callback);

    }

    public static void deleteJianLiEdu(String edu_id, Callback<ResponseBody> callback) {
        Call<ResponseBody> jianLiUpModleCall = userService.deleteJianLiEdu(DelResumeEduUrl, edu_id);
        jianLiUpModleCall.enqueue(callback);

    }


    public static void upJianLiWork(String json, Callback<ResponseBody> callback) {
        Call<ResponseBody> jianLiUpModleCall = userService.addJianLiEdu(AddResumeWorkUrl, json);
        jianLiUpModleCall.enqueue(callback);

    }

    public static void addJianLiEdu(String json, Callback<ResponseBody> callback) {
        Call<ResponseBody> jianLiUpModleCall = userService.addJianLiWork(AddResumeEduUrl, json);
        jianLiUpModleCall.enqueue(callback);

    }

    public static void getJianLi(String member_id, Callback<JianLiModle> callback) {
        Call<JianLiModle> jianLi = userService.getJianLi(GetResumeUrl, member_id);
        jianLi.enqueue(callback);
    }

    public static void upJianLi(String json, Callback<ResponseBody> callback) {
        Call<ResponseBody> jianLiUpModleCall = userService.upJianLi(UpdateResumeUrl, json);
        jianLiUpModleCall.enqueue(callback);

    }


    public static void selectByMemberId(int memberId, Subscriber<SelectByMemberIdRes> subscriber) {
        userService.selectByMemberId(memberId)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    public static void getCity(Callback<ResponseBody> subscriber) {
        Call<ResponseBody> city = userService.getCity(getCityUrl);
        city.enqueue(subscriber);
    }

    public static void GetBlackList(int page, int pageSize, Callback<ResponseBody> callback) {
        Call<ResponseBody> blackUser = userService.getBlackUser(GetBlackListUrl, page, pageSize);
        blackUser.enqueue(callback);
    }

    public static void addBlackUser(Context context, int type, String to_uid, Callback<ResponseBody> callback) {
        int memberId = SharedPreferenceUtils.getMemberId(context);
        if (to_uid.equals("0") || to_uid.equals("" + memberId)) {
            if (to_uid.equals("0")) {
                LogUtils.startToash(context, AppConstant.userNo);
            }
            LogUtils.startToash(context, AppConstant.userself);

            return;
        }
        Call<ResponseBody> blackUser = userService.addBlackUser(BlackUserUrl, type, to_uid);
        blackUser.enqueue(callback);
    }

    public static void GetFollowerList(int type, int page, int pageSize, Callback<ResponseBody> callback) {
        Call<ResponseBody> blackUser = userService.GetFollowerList(GetFollowerListUrl, type, page, pageSize);
        blackUser.enqueue(callback);
    }

    public static void addFollowerUser(Context context, int type, String to_uid, Callback<ResponseBody> callback) {
        int memberId = SharedPreferenceUtils.getMemberId(context);
        if (to_uid.equals("0") || to_uid.equals("" + memberId)) {
            if (to_uid.equals("0")) {
                LogUtils.startToash(context, AppConstant.userNo);
            }
            LogUtils.startToash(context, AppConstant.userself);

            return;
        }
        Call<ResponseBody> blackUser = userService.addFollowerUser(FollowerUserUrl, type, to_uid);
        blackUser.enqueue(callback);
    }

    public static void addFollowerUser2(int type, String to_uid, Callback<MyResponseBody> callback) {

        Call<MyResponseBody> blackUser = userService.addFollowerUser2(FollowerUserUrl, type, to_uid);
        blackUser.enqueue(callback);
    }


    /**
     * 忘记密码
     *
     * @param subscriber
     */
    public static void updateByMemberPasswordWhenForget(String mobile, String pwd, String identCode, Subscriber<ForgetPwdRes> subscriber) {
        userService.updateByMemberPasswordWhenForget(mobile, pwd, identCode)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    //demo
    public static void createMember(String mobile, String pwd, String identCode, Subscriber<CreateMemberRes> subscriber) {
        userService.createMember(mobile, pwd, identCode)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }


    /**
     * 根据手机号码查询会员（会员是否已注册）
     *
     * @param subscriber
     */
    public static void selectByMobile(String mobile, Subscriber<SelectByMobileRes> subscriber) {
        userService.selectByMobile(mobile)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    /**
     * @param subscriber
     */
    public static void sendMsg(String mobile, int type, Subscriber<CommonRes> subscriber) {
        userService.sendMsg(mobile, type)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    /**
     * 根据手机号码和密码查询会员(登录)
     *
     * @param subscriber
     */
    public static void selectByMobileAndPwd(String mobile, String pwd, String deviceId, String clientId, Subscriber<SelectByMobileAndPwdRes> subscriber) {
        userService.selectByMobileAndPwd(mobile, pwd, deviceId, "2", clientId)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    public static void getMaterialByCategoryId(int category_id, int page, int pageSize, Subscriber<GetMaterialByCategoryIdRes> subscriber) {
        userService.getMaterialByCategoryId(category_id, page, pageSize)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    public static void getMaterialCategory(Subscriber<GetMaterialCategoryRes> subscriber) {
        userService.getMaterialCategory()
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    public static void getEnterpriseMaterial(String uid, int page, int pageSize, Subscriber<GetEnterpriseMaterialRes> subscriber) {
        userService.getEnterpriseMaterial(uid, page, pageSize)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    public static void delMemberMaterial(int uid, int material_id, Subscriber<CommonRes> subscriber) {
        userService.delMemberMaterial(uid, material_id)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    public static void getEnterpriseAdvert(String uid, Subscriber<GetAdvertByUidRes> subscriber) {
        userService.getEnterpriseAdvert(uid)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }


    public static void getWeekStatisticalResult(String uid, Subscriber<GetWeekStatisticalResultRes> subscriber) {
        userService.getWeekStatisticalResult(uid)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    public static void getDayStatisticalResult(String uid, String date, int sort, int page, int pageSize, Subscriber<GetDayStatisticalResultRes> subscriber) {
        userService.getDayStatisticalResult(uid, date, sort, page, pageSize)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    //【企业数据统计】[uid]
    public static void getEnterpriseReport(String uid, Subscriber<GetEnterpriseReportRes> subscriber) {
        userService.getEnterpriseReport(uid)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }


    public static void getPicSubjectList(int page, int pageSize, int type, Subscriber<GetEntertainmentListRes> subscriber) {
        userService.getPicSubjectList(page, pageSize, type)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    public static void getEntertainmentList(int page, int pageSize, int type, Subscriber<GetEntertainmentListRes> subscriber) {
        userService.getEntertainmentList(page, pageSize, type)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    public static void getPlateSore(Callback<PlateSoreModle> callback) {
        Call<PlateSoreModle> responseBodyCall = userService.GetPlateSortList(GetPostCagetoryUrl);
        responseBodyCall.enqueue(callback);


    }

    public static void uploadPlate(String content, Callback<RequstReq> callback) {

        Call<RequstReq> responseBodyCall = userService.uploadPlate(insertPlateUrl, content);
        responseBodyCall.enqueue(callback);
    }

    /**
     * 上传图片
     *
     * @param subscriber
     */
    public static void uploadImg(String key, String serializedData, String type, Subscriber<UploadImgRes> subscriber) {
        userService.uploadImg(key, serializedData, type)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);

    }

    public static void getPlateList(int category_id, int type, int page, int page_size, Callback<PlateListModle> callback) {
        Call<PlateListModle> plateList = userService.getPlateList(getPlateListUrl, category_id, type, page, page_size);
        plateList.enqueue(callback);
    }

    /**
     * 根据文章栏目ID查询文章,返回列表
     *
     * @param subscriber
     */
    public static void selectByCategoryId(String categoryId, int pageNum, int PageSize, Subscriber<SelectByCategoryIdRes> subscriber) {
        userService.selectByCategoryId("1001", pageNum, PageSize)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    public static void GetKanTieListUrl(int type, int pageNum, int PageSize, Callback<KanTieListModle> callback) {
        Call<KanTieListModle> kanTieList = userService.getKanTieList(getKanTieListUrl, type, pageNum, PageSize);
        kanTieList.enqueue(callback);

    }


    public static void getEnterpriseRank(String uid, int sort, int type, int page, int pageSize, Subscriber<GetEnterpriseRankRes> subscriber) {
        userService.getEnterpriseRank(uid, sort, type, page, pageSize)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }


    /**
     * 获取Web页面地址
     *
     * @param subscriber
     */
    public static void getWebUrl(String url, Subscriber<GetWebUrlRes> subscriber) {
        userService.getWebUrl(url)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    /**
     * 获取形象空间所有信息
     *
     * @param subscriber
     */
    public static void getHomePageByUid(String uid, Subscriber<GetHomePageByUidRes> subscriber) {
        userService.getHomePageByUid(uid)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    /**
     * 更新形象空间
     *
     * @param subscriber
     */
    public static void updateHomePageInfo(String uid, int type, String json, Subscriber<CommonRes> subscriber) {
        userService.updateHomePageInfo(uid, type, json)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    public static void getAdTemp(String uid, Subscriber<GetAdvertByUidRes> subscriber) {
        userService.getAdTemp(uid)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    public static void updateAdvert(String uid, String json, Subscriber<CommonRes> subscriber) {
        userService.updateAdvert(uid, json)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .unsubscribeOn(Schedulers.io())
                .subscribe(subscriber);
    }

    public static void followerPlater(int type, int firstId, int id, Callback<ResponseBody> subscriber) {
        Call<ResponseBody> requstReqCall = userService.followerPlateSort(FollowerCategoryUrl, type, firstId, id);
        requstReqCall.enqueue(subscriber);

    }

    ;


}
